package org.autumn.thread;


import java.util.concurrent.TimeUnit;

public class SleepMethod {

    public static void main(String[] args) {
        Thread t1 = new Thread(()->{
            try {
                TimeUnit.SECONDS.sleep(2);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        },"t1");
        System.out.println("t1.getState() = " + t1.getState());
        t1.start();
        System.out.println("t1.getState() = " + t1.getState());

        try {
            TimeUnit.SECONDS.sleep(1);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("t1.getState() = " + t1.getState());
    }
}
